package com.zlp.dto.resource;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author SLONGHUI
 * @create 2022/5/24 16:18
 */
@Data
@ApiModel("资源位商品返回列表")
public class ProductResp implements Serializable {

    @ApiModelProperty("商品id")
    private List<ProductDetailResp> productDetailRespList = initData();


    @Data
    @ApiModel("资源位商品列表")
    public static class ProductDetailResp extends ResourceBaseResp{

        @ApiModelProperty("商品id")
        private String spuId;

        @ApiModelProperty("商品名称")
        private String spuName;

        @ApiModelProperty("商品简介")
        private String describe;

        @ApiModelProperty("折扣")
        private String discount;

        @ApiModelProperty("商品图片")
        private String pictureURL;

        @ApiModelProperty("icon图片")
        private String iconURL;

        @ApiModelProperty("价格")
        private Integer price;

        @ApiModelProperty("v值")
        private Integer v;

        @ApiModelProperty("划线价格")
        private Integer originalPrice;

        @ApiModelProperty("划线v值")
        private Integer originalV;

        @ApiModelProperty("补货状态 0-待补货 1-有货")
        private Integer sellStockStatus;

        @ApiModelProperty("51071001-在线支付 51071002-V值支付， 51071003-现金支付（附件包用）")
        private Integer payType;
    }

    public static List<ProductDetailResp> initData() {

        List<ProductDetailResp> productDetailRespList = new ArrayList<>();
        ProductDetailResp productDetailResp = new ProductDetailResp();
        productDetailResp.setSpuId("123");
        productDetailResp.setSpuName("测试商品");
        productDetailResp.setDescribe("323");
        productDetailResp.setDiscount("8.0折");
        productDetailResp.setPictureURL("https://t12.baidu.com/it/u=3165178178,1926556480&fm=58");
        productDetailResp.setIconURL("无");
        productDetailResp.setPrice(10);
        productDetailResp.setV(10);
        productDetailResp.setOriginalPrice(20);
        productDetailResp.setOriginalV(60);
        productDetailResp.setSellStockStatus(1);
        productDetailResp.setPayType(51071001);
        productDetailRespList.add(productDetailResp);

        return productDetailRespList;
    }
}



